package action.message;

import org.apache.struts2.ServletActionContext;

import service.UserService;
import bean.User;

import com.opensymphony.xwork2.ActionSupport;

public class CheckMessagesAction extends ActionSupport {
	private UserService userService;
	@Override
	public String execute() throws Exception {
		User user=(User) ServletActionContext.getContext().getSession().get("user");
		user=userService.viewUserById(user.getId());
		ServletActionContext.getRequest().setAttribute("messages", user.getMessages());
		return SUCCESS;
	}
	public UserService getUserService() {
		return userService;
	}
	public void setUserService(UserService userService) {
		this.userService = userService;
	}
	
}
